//! Header for the Shape-class
/*!
	\file Shape.h
	\author Andreas Lehner
	\date 13.11.2012

*/
#ifndef SHAPE_H
#define SHAPE_H

#include <string>
#include "Object.h"

//! Describes the position of a shape on a picture
/*!
\struct TPosition
This struct holds the horizontal x-value and the vertical
y-value of a shape.
*/
struct TPosition {
  //! Holds the x coordinate.
	float x;
  
  //! Holds the y coordinate.
	float y;
};

//! Describes the dimensions of a rectangle
/*!
\struct TSize
This struct holds the width and the height of a Rectangle.
Defined in Shape.h because it is used from the Picture.
*/
struct TSize {
  //! Holds the width.
	float width;
  
  //! holds the height.
	float height;
};

//! Describes a Shape (holds position and color of the shape)
/*!
\class Shape
The class Shape holds information about the x and y position of the shape on a picture and its color.
It is not allowed to copy or assign Shapes. Strategy pattern is used to print a Rectangle or a Circle.
*/
class Shape : public Object {
public:
	//! DTor of Shape
	/*!
	Destructor is virtual for object destruction in derived classes to call their destructor
	*/
	virtual ~Shape(){};
	//! Write a circle to ostream
	/*!
	Writes a circle to ostream by delegating to the function DoWrite, writing a
	filled or transparent circle. It is implemented in class Circle and Rectangle. (template method)
	\param stream The stream where output is written to.
	*/
	virtual void WriteShape(std::ostream & stream) = 0;

protected:
	//! CTor of Shape
	/*!
	Constructs a Shape by initializing its position and color.
	\param pos The position of the circle on a picture.
	\param color The color a circle has.
	*/
	Shape(TPosition const& pos, std::string const& color) : mX(pos.x), mY(pos.y), mColor(color){};
	//! x-position of a shape
	/*!
	The x-value of a shape. (horizontal)
	*/
	float mX;
	//! y-position of a shape
	/*!
	The y-value of a shape. (vertical)
	*/
	float mY;
	//! color of a shape
	/*!
	The color of the shape is stored as a color name. (black, blue, ex.)
	These color names must be interpretable by a svg file.
	*/
	std::string mColor;

private:
	//private CCtor and assignment operator => it is not allowed
	//to copy or assign a Shape
	Shape(Shape const& shape){};
	Shape& operator=(Shape const& shape){};
};

#endif